<!-- extends表明此页面继承自 base.html 文件 -->
{% extends "base.html" %} {% load staticfiles %}
<!-- 写入 base.html 中定义的 title -->
{% block title %} 写文章 {% endblock title %}
<!-- 写入 base.html 中定义的 content -->
{% block content %}
<!-- 写文章表单 -->
<div class="container">
    <div class="row">
        <div class="col-12">
            <br>
            <!-- 提交文章的表单 -->
            <form method="post" action="." enctype="multipart/form-data">
                <!-- Django中需要POST数据的地方都必须有csrf_token -->
                {% csrf_token %}
                <!-- 文章标题 -->
                <div class="form-group">
                    <!-- 标签 -->
                    <label for="title">文章标题</label>
                    <!-- 文本框 -->
                    <input type="text" class="form-control" id="title" name="title">
                </div>

                <!-- 文章标题图 -->
                <div class="form-group">
                    <label for="avatar">标题图</label>
                    <input type="file" class="form-control-file" name="avatar" id="avatar">
                </div>

                <!-- 文章栏目 -->
                <div class="form-group">
                    <label for="column">栏目</label>
                    <select class="form-control col-3"
                            id="column"
                            name="column"
                    >
                            <option value="none">请选择栏目..</option>
                        {% for column in columns %}
                            <option value="{{ column.id }}">{{ column }}</option>
                        {% endfor %}
                    </select>

                    <!-- 文章标签 -->

                    <label for="tags">标签</label>
                    <input type="text"
                           class="form-control col-3"
                           id="tags"
                           name="tags"
                    >

                </div>

{#                <editor-fold desc="haha">#}
{#                <div class="container">#}
{#                    <div class="row clearfix">#}
{#                        <div class="col-md-12 column">#}
{#                            <div class="row clearfix">#}
{#                                <div class="col-md-12 column">#}
{#                                     <button type="button" class="btn btn-default">按钮</button>#}
{#                                    <label for="column">栏目</label>#}
{#                                    <select class="form-control col-3"#}
{#                                            id="column"#}
{#                                            name="column"#}
{#                                    >#}
{#                                            <option value="none">请选择栏目..</option>#}
{#                                        {% for column in columns %}#}
{#                                            <option value="{{ column.id }}">{{ column }}</option>#}
{#                                        {% endfor %}#}
{#                                    </select>#}
{#                                </div>#}
{#                            </div>#}
{#                            <div class="row clearfix">#}
{#                                <div class="col-md-12 column">#}
{#                                     <button type="button" class="btn btn-default">按钮</button>#}
{#                                    <label for="tags">标签</label>#}
{#                                    <input type="text"#}
{#                                           class="form-control col-3"#}
{#                                           id="tags"#}
{#                                           name="tags"#}
{#                                    >#}
{#                                </div>#}
{#                            </div>#}
{#                        </div>#}
{#                        <div class="col-md-4 column">#}
{#                        </div>#}
{#                        <div class="col-md-4 column">#}
{#                        </div>#}
{#                    </div>#}
{#                </div>#}
{#            </editor-fold>#}


                <!-- 文章正文 -->
                <div class="form-group">
                    <label for="body">文章正文</label>
                    <!-- 文本区域 -->
                    <textarea type="text" class="form-control" id="body" name="body" rows="12"></textarea>
                </div>

                <div class="form-group">
                    <label for="title">链接</label>
                     <input type="text" class="form-control" id="href" name="href">
                </div>

                <div class="form-group">
                    <label for="title">链接标题</label>
                     <input type="text" class="form-control" id="href_title" name="href_title">
                </div>

                <!-- 提交按钮 -->
                <button type="submit" class="btn btn-primary">完成</button>
            </form>
        </div>
    </div>
</div>
{% endblock content %}